package com.tongqin.distributed.vip;

/**
 * @author yuantongqin
 * @date 2018/8/29 上午10:43
 */
public class GPSqlSession {

    GPConfiguration configuration;
    GPExecutor executor;

    public GPSqlSession(GPConfiguration configuration, GPExecutor executor) {
        this.configuration = configuration;
        this.executor = executor;
    }

    /**
     * 这里是获取mapper的代理对象
     *
     */
    public <T> T getMapper(Class<T> tClass){
        return configuration.getMapper(tClass,this);
    }

    /**
     * 根据sql查询
     */
    public <T> T selectOne(String statement,String params){
        return executor.query(statement,params);
    }


}
